package com.ruoyi.user.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.user.mapper.UserVoiceCallMapper;
import com.ruoyi.user.domain.UserVoiceCall;
import com.ruoyi.user.service.IUserVoiceCallService;

/**
 * 用户语音通话Service业务层处理
 * 
 * @author DEREK
 * @date 2023-08-15
 */
@Service
public class UserVoiceCallServiceImpl extends ServiceImpl<UserVoiceCallMapper, UserVoiceCall> implements IUserVoiceCallService 
{
    @Autowired
    private UserVoiceCallMapper userVoiceCallMapper;

    /**
     * 查询用户语音通话
     * 
     * @param id 用户语音通话主键
     * @return 用户语音通话
     */
    @Override
    public UserVoiceCall selectUserVoiceCallById(Long id)
    {
        return userVoiceCallMapper.selectUserVoiceCallById(id);
    }

    /**
     * 查询用户语音通话列表
     * 
     * @param userVoiceCall 用户语音通话
     * @return 用户语音通话
     */
    @Override
    public List<UserVoiceCall> selectUserVoiceCallList(UserVoiceCall userVoiceCall)
    {
        return userVoiceCallMapper.selectUserVoiceCallList(userVoiceCall);
    }

    /**
     * 新增用户语音通话
     * 
     * @param userVoiceCall 用户语音通话
     * @return 结果
     */
    @Override
    public int insertUserVoiceCall(UserVoiceCall userVoiceCall)
    {
        userVoiceCall.setCreateTime(DateUtils.getNowDate());
        return userVoiceCallMapper.insertUserVoiceCall(userVoiceCall);
    }

    /**
     * 修改用户语音通话
     * 
     * @param userVoiceCall 用户语音通话
     * @return 结果
     */
    @Override
    public int updateUserVoiceCall(UserVoiceCall userVoiceCall)
    {
        return userVoiceCallMapper.updateUserVoiceCall(userVoiceCall);
    }

    /**
     * 批量删除用户语音通话
     * 
     * @param ids 需要删除的用户语音通话主键
     * @return 结果
     */
    @Override
    public int deleteUserVoiceCallByIds(Long[] ids)
    {
        return userVoiceCallMapper.deleteUserVoiceCallByIds(ids);
    }

    /**
     * 删除用户语音通话信息
     * 
     * @param id 用户语音通话主键
     * @return 结果
     */
    @Override
    public int deleteUserVoiceCallById(Long id)
    {
        return userVoiceCallMapper.deleteUserVoiceCallById(id);
    }
}
